<?php 
define ( 'IN_UCHOME', '1' );
include_once '../common.php';

$_SGLOBAL ['supe_uid'] = 1;

$email = $_REQUEST ['e'];
$pwmd5 = $_REQUEST ['p'];

$auth = checkAuth ( $email, $pwmd5 );

if($auth['status']==0){
	echo $auth['err'];exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片批量上传</title>
<script type="text/javascript">
	var baseUrl = './uploadify';
</script>

<link rel="stylesheet" href="./css.css" type="text/css" />

<link rel="stylesheet" href="./uploadify/uploadify.css" type="text/css" />

<link rel="stylesheet" href="./ui/jquery-ui.css" type="text/css" />
<style type="text/css">
#wrapper{padding:8px;}
#uploadFileDiv {
	position: relative;
	height: 80px;
}

#fileQueue {
	position: absolute;
	height: 60px;
	width: 500px;
	left: 160px;
	top: 0;
	overflow: hidden;
}
body{background:none;background-color:#fff;}
#wrapper{width:630px;background:#fff;overflow-x:hidden;padding:0;padding-top:8px;margin:0 0 0 5px;}
.message{color:#fff;}
</style>
<!-- Our CSS stylesheet file -->
<link rel="stylesheet" href="html5-drag-and-drop/css/styles.css" />

<!--[if lt IE 9]>
          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
</head>
<body>


	<div id="wrapper">

		<div id="loginBox"
			style="text-align: left; width: 99%; margin: 0 auto;">
			<h1>图片批量上传</h1>
			<div id="msg"
				style="margin: 5px; font-size: 13px; color: red; ">
			</div>
			<div id="dropbox">
				<span class="message">Drop images here to upload. <br />
				<i>(they will only be visible to you)</i></span>
			</div>
			
			<div align="left" id="imagesDiv" style="width:645px;">
			
			
			<div style='clear: both;height:1px;overflow:hidden;'>&nbsp;</div>
			</div>
		</div>
		

	</div>
</body>

<script type="text/javascript" src="./uploadify/jquery.min.js"></script>
<script>
function getQueryString(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}

function thumbShow(src){
	var img = new Image();
	img.src = src;
	var wrapWidth = 150;
	var wrapHeight = 170;
	var marginLeft = 0;
	var marginTop = 0;
	var width_ = height_ = 0;
	img.onload = function () {
		var width  = this.width;
		var height = this.height;

		var  scale_org = wrapWidth/wrapHeight;

		if (wrapWidth / width > wrapHeight / height)
		{
			height_ = wrapHeight;
			width_ = width  * wrapHeight/height;
		} else
		{
			width_ = wrapWidth;
			height_ = height * wrapWidth/width;
		}
		marginLeft = (wrapWidth-width_)/2+1;
		marginTop = (wrapHeight-height_)/2+1;
		$("#imagesDiv").prepend("<div class='imgWrap'><a href='"+src+"' target='_blank'><img src='" + src+  "' style='width:"+width_+"px;height:"+height_+"px;margin-left:"+marginLeft+"px;margin-top:"+marginTop+"px;'/></a></div>");
		
	};  
}
</script>
<!-- Including the HTML5 Uploader plugin -->
<script src="html5-drag-and-drop/js/jquery.filedrop.js"></script>

<!-- The main script file -->
<script>
var drag_drop_url = "../api.php?f=drag-drop&e=<?php echo $_GET['e']?>&p=<?php echo $_GET['p'];?>";

</script>
<script src="html5-drag-and-drop/js/script.js"></script>


</html>